//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    internal class ColorReplaceEffect : Effect
    {
        private ColorBase color;

        public ColorBase Color
        {
            get { return color; }
            set { color = value; }
        }

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("clrRepl"))
            {
                Color = ColorBase.ReadColor(c);
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("clrRepl"))
            {
                c.WriteElement(Color);
            }
        }
    }
}